package com.hnqcgczy.ssy.db;

import java.sql.*;

public abstract class IConnection {
    /**
     * 打开数据库链接
     * @return
     * @throws SQLException
     */
    public abstract Connection getConnMysql()throws SQLException;
    public abstract Connection getConnOracle()throws SQLException;

    /**
     * 释放资源
     * @param ps
     * @param rs
     * @param s
     * @throws SQLException
     */
    public void close(PreparedStatement ps,ResultSet rs,Statement s)throws SQLException{
        if (ps!=null){
            ps.close();
        }
        if (rs!=null){
            rs.close();
        }
        if (s!=null){
            s.close();
        }
    }
}